package com.spi.soconversion.base.definition;

import java.util.ArrayList;
import java.util.List;

public class OrderLine {

	private String deliveryMethod;
	private String fullfillmentType;
	private String isPriceLocked = "Y";
	private String itemGroupCode;
	private String itemCategory;
	private String lineType;
	private String lineStatus;
	private String orderedQty;
	private String pickableFlag = "Y";
	private String primeLineNo;
	private String promisedApptStartDate;
	private String promisedApptEndDate;	
	private String reqDeliveryDate;
	private String reqShipDate;
	private String shipNode;
	private String shipToId;
	private String subLineNo = "1";
	private String shipToKey;
	private String serviceRefLineId;
	
	private OrderLineExtension orderLineExtension = new OrderLineExtension();
	private DerivedFrom derivedFrom = null;
	private List<OrderLineOption> orderLineOptionsList = new ArrayList<OrderLineOption>();
	private Item item = new Item();
	private PersonInfoShipTo personInfoShipTo = new PersonInfoShipTo();
	private LinePriceInfo linePriceInfo = new LinePriceInfo();
	private List<LineCharge> orderLineChargesList = new ArrayList<LineCharge>();	
	private List<LineTax> orderLineTaxesList = new ArrayList<LineTax>();
	
	public boolean addOrderLineOption(OrderLineOption lc) {
		boolean status = false;
		if (!orderLineOptionsList.contains(lc)) {
			status = orderLineOptionsList.add(lc);
		}
		return status;
	}

	public boolean removeOrderLineOption(OrderLineOption lc) {
		boolean status = false;
		status = orderLineOptionsList.remove(lc);
		return status;
	}

	public List<OrderLineOption> getOrderLineOptionList() {
		return orderLineOptionsList;
	}

	public boolean addLineCharge(LineCharge lc) {
		boolean status = false;
		if (!orderLineChargesList.contains(lc)) {
			status = orderLineChargesList.add(lc);
		}
		return status;
	}

	public boolean removeLineCharge(LineCharge lc) {
		boolean status = false;
		status = orderLineChargesList.remove(lc);
		return status;
	}

	public List<LineCharge> getLineChargeList() {
		return orderLineChargesList;
	}

	public LineCharge[] getLineChargeArray() {
		LineCharge[] result = new LineCharge[orderLineChargesList.size()];
		orderLineChargesList.toArray(result);
		return result;
	}

	public boolean addLineTax(LineTax lc) {
		boolean status = false;
		if (!orderLineTaxesList.contains(lc)) {
			status = orderLineTaxesList.add(lc);
		}
		return status;
	}

	public boolean removeLineTax(LineCharge lc) {
		boolean status = false;
		status = orderLineTaxesList.remove(lc);
		return status;
	}

	public List<LineTax> getLineTaxList() {
		return orderLineTaxesList;
	}

	public LineTax[] getLineTaxArray() {
		LineTax[] result = new LineTax[orderLineTaxesList.size()];
		orderLineTaxesList.toArray(result);
		return result;
	}

	public OrderLineExtension getOrderLineExtension() {
		return orderLineExtension;
	}

	public void setOrderLineExtension(OrderLineExtension orderLineExtension) {
		this.orderLineExtension = orderLineExtension;
	}

	public DerivedFrom getDerivedFrom() {
		return derivedFrom;
	}

	public void setDerivedFrom(DerivedFrom derivedFrom) {
		this.derivedFrom = derivedFrom;
	}

	public List<OrderLineOption> getOrderLineOptions() {
		return orderLineOptionsList;
	}

	public void setOrderLineOptions(List<OrderLineOption> orderLineOptionsList) {
		this.orderLineOptionsList = orderLineOptionsList;
	}

	public OrderLineOption[] getOrderLineOptionArray() {
		OrderLineOption[] result = new OrderLineOption[orderLineOptionsList.size()];
		orderLineOptionsList.toArray(result);
		return result;
	}

	public Item getItem() {
		return item;
	}

	public String getItemCategory() {
		return itemCategory;
	}

	public void setItemCategory(String itemCategory) {
		this.itemCategory = itemCategory;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	public PersonInfoShipTo getPersonInfoShipTo() {
		return personInfoShipTo;
	}

	public void setPersonInfoShipTo(PersonInfoShipTo personInfoShipTo) {
		this.personInfoShipTo = personInfoShipTo;
	}

	public LinePriceInfo getLinePriceInfo() {
		return linePriceInfo;
	}

	public void setLinePriceInfo(LinePriceInfo linePriceInfo) {
		this.linePriceInfo = linePriceInfo;
	}

	public List<LineCharge> getLineCharges() {
		return orderLineChargesList;
	}

	public void setLineCharges(List<LineCharge> orderLineChargesList) {
		this.orderLineChargesList = orderLineChargesList;
	}

	public List<LineTax> getLineTaxes() {
		return orderLineTaxesList;
	}

	public void setLineTaxes(List<LineTax> orderLineTaxesList) {
		this.orderLineTaxesList = orderLineTaxesList;
	}

	public String getDeliveryMethod() {
		return deliveryMethod;
	}
	
	public void setDeliveryMethod(String deliveryMethod) {
		this.deliveryMethod = deliveryMethod;
	}
	
//	public String getGiftFlag() {
//		return giftFlag;
//	}
//	
//	public void setGiftFlag(String giftFlag) {
//		this.giftFlag = giftFlag;
//	}
//	
//	public String getGiftWrap() {
//		return giftWrap;
//	}
//	
//	public void setGiftWrap(String giftWrap) {
//		this.giftWrap = giftWrap;
//	}
//	
//	public String getHoldFlag() {
//		return holdFlag;
//	}
//	
//	public void setHoldFlag(String holdFlag) {
//		this.holdFlag = holdFlag;
//	}
//	
//	public String getIsProcurementAllowed() {
//		return isProcurementAllowed;
//	}
//	
//	public void setIsProcurementAllowed(String isProcurementAllowed) {
//		this.isProcurementAllowed = isProcurementAllowed;
//	}
	
	public String getItemGroupCode() {
		return itemGroupCode;
	}
	
	public void setItemGroupCode(String itemGroupCode) {
		this.itemGroupCode = itemGroupCode;
	}
	
	public String getLineType() {
		return lineType;
	}
	
	public void setLineType(String lineType) {
		this.lineType = lineType;
	}
	
	public String getOrderedQty() {
		return orderedQty;
	}
	
	public void setOrderedQty(String orderedQty) {
		this.orderedQty = orderedQty;
	}
	
	public String getPrimeLineNo() {
		return primeLineNo;
	}
	
	public void setPrimeLineNo(String primeLineNo) {
		this.primeLineNo = primeLineNo;
	}
	
//	public String getProcureFromNode() {
//		return procureFromNode;
//	}
//	
//	public void setProcureFromNode(String procureFromNode) {
//		this.procureFromNode = procureFromNode;
//	}
//	
//	public String getReceivingNode() {
//		return receivingNode;
//	}
//	
//	public void setReceivingNode(String receivingNode) {
//		this.receivingNode = receivingNode;
//	}
	
	public String getReqDeliveryDate() {
		return reqDeliveryDate;
	}
	
	public void setReqDeliveryDate(String reqDeliveryDate) {
		this.reqDeliveryDate = reqDeliveryDate;
	}
	
	public String getShipNode() {
		return shipNode;
	}
	
	public void setShipNode(String shipNode) {
		this.shipNode = shipNode;
	}
	
	public String getShipToId() {
		return shipToId;
	}
	
	public void setShipToId(String shipToId) {
		this.shipToId = shipToId;
	}
	
	public String getSubLineNo() {
		return subLineNo;
	}
	
	public void setSubLineNo(String subLineNo) {
		this.subLineNo = subLineNo;
	}

	public String getPriceLocked() {
		return isPriceLocked;
	}

	public void setPriceLocked(String priceLocked) {
		this.isPriceLocked = priceLocked;
	}

	public String getPickableFlag() {
		return pickableFlag;
	}

	public void setPickableFlag(String pickableFlag) {
		this.pickableFlag = pickableFlag;
	}

	public String getReqShipDate() {
		return reqShipDate;
	}

	public void setReqShipDate(String reqShipDate) {
		this.reqShipDate = reqShipDate;
	}

	public String getShipToKey() {
		return shipToKey;
	}

	public void setShipToKey(String shipToKey) {
		this.shipToKey = shipToKey;
	}

	public String getFullfillmentType() {
		return fullfillmentType;
	}

	public void setFullfillmentType(String fullfillmentType) {
		this.fullfillmentType = fullfillmentType;
	}

	public String getIsPriceLocked() {
		return isPriceLocked;
	}

	public void setIsPriceLocked(String isPriceLocked) {
		this.isPriceLocked = isPriceLocked;
	}

	public String getLineStatus() {
		return lineStatus;
	}

	public void setLineStatus(String lineStatus) {
		this.lineStatus = lineStatus;
	}

	public String getPromisedApptStartDate() {
		return promisedApptStartDate;
	}

	public void setPromisedApptStartDate(String promisedApptStartDate) {
		this.promisedApptStartDate = promisedApptStartDate;
	}

	public String getPromisedApptEndDate() {
		return promisedApptEndDate;
	}

	public void setPromisedApptEndDate(String promisedApptEndDate) {
		this.promisedApptEndDate = promisedApptEndDate;
	}

	public List<OrderLineOption> getOrderLineOptionsList() {
		return orderLineOptionsList;
	}

	public void setOrderLineOptionsList(List<OrderLineOption> orderLineOptionsList) {
		this.orderLineOptionsList = orderLineOptionsList;
	}

	public List<LineCharge> getOrderLineChargesList() {
		return orderLineChargesList;
	}

	public void setOrderLineChargesList(List<LineCharge> orderLineChargesList) {
		this.orderLineChargesList = orderLineChargesList;
	}

	public List<LineTax> getOrderLineTaxesList() {
		return orderLineTaxesList;
	}

	public void setOrderLineTaxesList(List<LineTax> orderLineTaxesList) {
		this.orderLineTaxesList = orderLineTaxesList;
	}

	public String getServiceRefLineId() {
		return serviceRefLineId;
	}

	public void setServiceRefLineId(String serviceRefLineId) {
		this.serviceRefLineId = serviceRefLineId;
	}

	@Override
	public String toString() {
        StringBuffer s = new StringBuffer();
        s.append("OrderLine[" + getDeliveryMethod() + ", " + getFullfillmentType()
        			+ ", " + getIsPriceLocked() + ", " + getItemGroupCode()
        			+ ", " + getLineType()
        			+ ", " + getLineStatus()
        			+ ", " + getOrderedQty()
        			+ ", " + getPickableFlag()
        			+ ", " + getPrimeLineNo()
        			+ ", " + getPromisedApptStartDate()
        			+ ", " + getPromisedApptEndDate()
        			+ ", " + getReqDeliveryDate()
        			+ ", " + getReqShipDate()
        			+ ", " + getShipNode()
        			+ ", " + getShipToId()
        			+ ", " + getSubLineNo()
        			+ ", " + getShipToKey()		        			
        			+ "]");
        return s.toString();
    }
}